--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
docs/en/nomadmesh-pages.md master (f0f6ed57) Text, 3.24 KB
Tc9d1d9# NomadNet page formats
MeshChatX serves pages from a **Mesh Server** page node and displays them in the **Nomad Network** browser. Pages are fetched with the Nomad path convention Ta5d6ff`/page/<filename>`.
Tc9d1d9## Supported filenames
| Extension | Role |
| --------- | ------------------------------------------------------- |
| Ta5d6ff`.mu` | Micron markup (NomadNet default) |
| Ta5d6ff`.md` | Markdown with GitHub-flavored features via the renderer |
| Ta5d6ff`.txt` | Plain text with escaped HTML and preserved whitespace |
| Ta5d6ff`.html` | Static HTML with CSS only (see security below) |
If you add a page without a recognised extension, the server stores it as Ta5d6ff`.mu`. Filenames with other extensions (for example Ta5d6ff`.exe`) are rejected when saving through the API.
Tc9d1d9## Plain text (`.txt`)
Content is HTML-escaped and shown with pre-wrapped whitespace. There is no Markdown parsing on Ta5d6ff`.txt` pages.
Tc9d1d9## Markdown (`.md`)
**Not the same engine as chat.** Conversations use the lightweight Ta5d6ff`MarkdownRenderer` in the messaging UI. Nomad Ta5d6ff`.md` pages use Ta5d6ff`marked` with GFM-oriented rules plus sanitisation. Features and edge cases can differ between the two paths. Automated tests cover both.
Authoring tips:
Tff7b72- Use ATX headings with a hash and a space before the title, for example Ta5d6ff`# Title`, Ta5d6ff`## Section`, Ta5d6ff`#### Subsection`.
Tff7b72- Fenced code blocks keep indentation.
Tff7b72- Off-mesh Ta5d6ff`http` and Ta5d6ff`https` links in rendered content are removed or restricted so the preview cannot drive external navigation without mesh-style URLs.
Tc9d1d9## HTML (`.html`)
Tff7b72- **JavaScript** is not executed. Ta5d6ff`script` tags and event-handler attributes are stripped.
Tff7b72- **External resources** are blocked where possible. Ta5d6ff`@import` and Ta5d6ff`url(...)` pointing at Ta5d6ff`http://`, Ta5d6ff`https://`, or protocol-relative URLs are removed from CSS.
Tff7b72- Embedded Ta5d6ff`<style>` blocks are kept. Rules that target Ta5d6ff`html` or Ta5d6ff`body` are rewritten to apply to the viewer root container.
Tff7b72- **Links** must be mesh-style (Ta5d6ff`:` paths, 32-character hex prefixes, Ta5d6ff`/page/...`, Ta5d6ff`/file/...`, or Ta5d6ff`#` fragments) or they are removed.
Tff7b72- **Images** only keep Ta5d6ff`data:image/...` inline sources.
Tff7b72- The viewer uses a sans-serif font for HTML and Markdown so pages do not inherit Micron monospace chrome. Override colours and typography with your own CSS.
Tc9d1d9## Mesh Server API
Tff7b72- Ta5d6ff`POST /api/v1/page-nodes/{node_id}/pages` with Ta5d6ff`name` and Ta5d6ff`content` saves a page. Invalid extensions return HTTP 400 with a short message.
Tff7b72- Optional Ta5d6ff`executable` marks the page as a shebang script. The node must also have executable pages enabled, or the file is served as static text.
Tff7b72- Listed pages only include files with allowed extensions in the Ta5d6ff`pages/` directory.
Tc9d1d9## Archives
Snapshots in **Archives** use the same rendering pipeline as the Nomad browser. The archived Ta5d6ff`page_path` extension selects Micron, Markdown, text, or HTML handling. Exports keep the original extension when it is Ta5d6ff`.mu`, Ta5d6ff`.md`, Ta5d6ff`.txt`, or Ta5d6ff`.html`.
Tc9d1d9## See also
Tff7b72- **Nomad Network and Mesh Server** for browsing and hosting workflows
Tff7b72- **Architecture and design** for where page nodes fit in the backend
Tff7b72- Default Nomad entry path remains Ta5d6ff`/page/index.mu` unless you change the URL in the browser
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────